package com.victor.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.victor.dao.PartnerDao;
import com.victor.entity.Shopuser;
import com.victor.entity.ShopuserXQ;
import com.victor.entity.ShopuserXQphoto;
import com.victor.entity.ShopuserXQyudingsm;
import com.victor.service.PartnerService;

@Service
public class PartnerServiceImpl implements PartnerService {

	@Autowired
	private PartnerDao dao;

	// 获取服务伙伴列表(根据类别查询 入住时间倒叙)
	@Override
	public List<Shopuser> getList(String shopclass, String starttime, String endtime) {
		return dao.getList(shopclass, starttime, endtime);
	}

	// 通过id查询服务伙伴详情
	@Override
	public Shopuser getXQbyid(String shopid) {
		return dao.getXQbyid(shopid);
	}

	// 添加操作日志
//	@Override
//	public int addShopuserLog(ShopuserLog shopuserLog) {
//		return dao.addShopuserLog(shopuserLog);
//	}

	// 新建服务伙伴
	@Override
	public boolean addShopuser(Shopuser shopuser) {
		return dao.addShopuser(shopuser) > 0 ? true : false;
	}

	// 冻结服务伙伴
	@Override
	public boolean frozenShopuser(String shopuserid) {
		return dao.frozenShopuser(shopuserid) > 0 ? true : false;
	}

	// 解除冻结服务伙伴
	@Override
	public boolean relieveFrozenShopuser(String shopuserid) {
		return dao.relieveFrozenShopuser(shopuserid) > 0 ? true : false;
	}

	// 批量删除服务伙伴
	@Override
	public boolean batchDelete(int[] suids) {
		return dao.batchDelete(suids) > 0 ? true : false;
	}

	// 查看操作日志
//	@Override
//	public List<ShopuserLog> getShopuserLogs() {
//		return dao.getShopuserLogs();
//	}

	// 修改商家信息
	@Override
	public boolean updateShopuser(Shopuser shopuser) {
		return dao.updateShopuser(shopuser) > 0 ? true : false;
	}

	// 添加详情返回id
	@Override
	public boolean addShopuserXQ(ShopuserXQ shopuserxq) {
		return dao.addShopuserXQ(shopuserxq) > 0 ? true : false;
	}

	// 添加内容-图片
	@Override
	public int addShopuserXQphoto(ShopuserXQphoto shopuserXQphoto) {
		return dao.addShopuserXQphoto(shopuserXQphoto);
	}

	// 添加内容-预定说明
	@Override
	public int addShopuserXQyudingsm(ShopuserXQyudingsm shopuserXQyudingsm) {
		return dao.addShopuserXQyudingsm(shopuserXQyudingsm);
	}

	// 删除内容
	@Override
	public boolean delContext(String shopuserxqid) {
		return dao.delContext(shopuserxqid) > 0 ? true : false;
	}

	// 删除预定说明
	@Override
	public boolean delYudingsm(String yudingsmid) {
		return dao.delYudingsm(yudingsmid) > 0 ? true : false;
	}

	// 修改房间信息
	@Override
	public boolean updateShopuserXQ(ShopuserXQ shopuserxq) {
		return dao.updateShopuserXQ(shopuserxq) > 0 ? true : false;
	}

	// 删除原图片
	@Override
	public boolean deleteXQphotoByxqid(Integer shopuserxqid) {
		return dao.deleteXQphotoByxqid(shopuserxqid) > 0 ? true : false;
	}

	// 添加新图片
	@Override
	public boolean insertXQphoto(ShopuserXQphoto shopuserXQphoto) {
		return dao.insertXQphoto(shopuserXQphoto) > 0 ? true : false;
	}
}
